const BASE_URL = "https://study.duyiedu.com/";
const Token_key = "token";

async function get(path) {
  const headers = {
    authorization: localStorage.getItem(Token_key),
  };
  return await fetch(BASE_URL + path, { headers });
}

async function post(path, params) {
  const headers = {
    "Content-Type": "application/json",
    authorization: localStorage.getItem(Token_key),
  };
  return await fetch(BASE_URL + path, {
    headers,
    body: params,
  });
}
